﻿@using EFDataModel
@model ContactManagement.Models.DetailsUserAdminModel
@{
    ViewBag.Title = PageTitles.UserDetailsRESX;
}

<div class="span12">
    <h2>@PageTitles.DetailsRESX: @Model.Firstname @Model.Lastname</h2>
    <hr />
</div>
<div class="span12">
    <form class="form-horizontal">
        <fieldset>
            @Html.ShowCustomMessage()

            <div class="control-group">
                <label class="control-label">
                    @Html.DisplayNameFor(model => model.UserTitle)
                </label>
                <div class="controls">
                    <span class="input-xlarge uneditable-input">
                        @Html.Categories().DisplayForCategory(Model.UserTitle)
                    </span>
                </div>
            </div>
            <div class="control-group">
                <label class="control-label">
                    @Html.DisplayNameFor(model => model.Firstname)
                </label>
                <div class="controls">
                    <span class="input-xlarge uneditable-input">
                        @Html.DisplayFor(model => model.Firstname)
                    </span>
                </div>
            </div>
            <div class="control-group">
                <label class="control-label">
                    @Html.DisplayNameFor(model => model.Lastname)
                </label>
                <div class="controls">
                    <span class="input-xlarge uneditable-input">
                        @Html.DisplayFor(model => model.Lastname)
                    </span>
                </div>
            </div>
            <div class="control-group">
                <label class="control-label">
                    @Html.DisplayNameFor(model => model.UserName)
                </label>
                <div class="controls">
                    <span class="input-xlarge uneditable-input">
                        @Html.DisplayFor(model => model.UserName)
                    </span>
                </div>
            </div>
            <div class="control-group">
                <label class="control-label">
                    @Html.DisplayNameFor(model => model.Category)
                </label>
                <div class="controls">
                    <span class="input-xlarge uneditable-input">
                        @Html.Categories().DisplayForCategory(Model.Category)
                    </span>
                </div>
            </div>
            <div class="control-group">
                <label class="control-label">
                    @Html.DisplayNameFor(model => model.UserType)
                </label>
                <div class="controls">
                    <span class="input-xlarge uneditable-input">
                        @Html.DisplayFor(model => model.UserType)
                    </span>
                </div>
            </div>
            <div class="control-group">
                <label class="control-label">
                    @Html.DisplayNameFor(model => model.IsActiveUser)
                </label>
                <div class="controls">
                    <span class="input-xlarge uneditable-input">
                        @Html.DisplayFor(model => model.IsActiveUser)
                    </span>
                </div>
            </div>
            <div class="control-group">
                <label class="control-label">
                    @Html.DisplayNameFor(model => model.Logintries)
                </label>
                <div class="controls">
                    <span class="input-xlarge uneditable-input">
                        @Html.DisplayFor(model => model.Logintries)
                    </span>
                </div>
            </div>
            <div class="control-group">
                <label class="control-label">
                    @Html.DisplayNameFor(model => model.Street)
                </label>
                <div class="controls">
                    <span class="input-xlarge uneditable-input">
                        @Html.DisplayFor(model => model.Street)
                    </span>
                </div>
            </div>
            <div class="control-group">
                <label class="control-label">
                    @Html.DisplayNameFor(model => model.HouseNumber)
                </label>
                <div class="controls">
                    <span class="input-xlarge uneditable-input">
                        @Html.DisplayFor(model => model.HouseNumber)
                    </span>
                </div>
            </div>
            <div class="control-group">
                <label class="control-label">
                    @Html.DisplayNameFor(model => model.ZipCode)
                </label>
                <div class="controls">
                    <span class="input-xlarge uneditable-input">
                        @Html.DisplayFor(model => model.ZipCode)
                    </span>
                </div>
            </div>
            <div class="control-group">
                <label class="control-label">
                    @Html.DisplayNameFor(model => model.City)
                </label>
                <div class="controls">
                    <span class="input-xlarge uneditable-input">
                        @Html.DisplayFor(model => model.City)
                    </span>
                </div>
            </div>


            <div class="control-group">
                <label class="control-label">
                    @Html.DisplayNameFor(model => model.Handy)
                </label>
                <div class="controls">
                    <span class="input-xlarge uneditable-input">
                        @Html.DisplayFor(model => model.Handy)
                    </span>
                </div>
            </div>
            <div class="control-group">
                <label class="control-label">
                    @Html.DisplayNameFor(model => model.Birthdate)
                </label>
                <div class="controls">
                    <span class="input-xlarge uneditable-input">
                        @Html.DisplayFor(model => model.Birthdate)
                    </span>
                </div>
            </div>
            @Html.DynamicDataType().DisplayFor(Model.DynamicData, EFModules.Member)
        </fieldset>
    </form>
</div>

<div class="span12">
    <div class="well">
        <h4>@GlobalResources.PageTitles.UserRightsRESX</h4>
        <br />
        <p>
            @Html.Users().ShowUserRights(Model.UserRights)
        </p>
    </div>
</div>

<div class="span12">
    <div class="well">
        <h4>@GlobalResources.PageTitles.UserGroupsRESX</h4>
        <br />
        <p>
            @Html.Users().ShowUserGroups(Model.UserGroups)
        </p>
    </div>
</div>

<div class="span12">
    <div class="well">
        @Html.ActionLink(Navigation.BackToListRESX, EActionUser.UserList.ToString(), EControllers.User.ToString(), null, new { @class = "btn btn-small", data_icon = "icon-arrow-left" })
        @if (WebRights.Right().Check(EUserRights.UserEdit))
        {
            @Html.ActionLink(Navigation.EditUserRESX, EActionUser.UserEdit.ToString(), new { id = Model.UserId }, new { @class = "btn btn-small" });
        }
        @if (WebRights.Right().Check(EUserRights.SetUserPassword))
        {
            @Html.ActionLink(Navigation.CreateUserPasswordRESX, EActionUser.UserSendNewPassword.ToString(), new { id = Model.UserId }, new { @class = "btn btn-small" });
        }
        @if (WebRights.Right().Check(EUserRights.SetUserGroups))
        {
            @Html.ActionLink(Navigation.EditUserGroupsRESX, EActionUser.UserEditUserGroups.ToString(), new { id = Model.UserId }, new { @class = "btn btn-small" })
        }
        @if (WebRights.Right().Check(EUserRights.SetUserRights))
        {
            @Html.ActionLink(Navigation.EditUserRightsRESX, EActionUser.UserEditUserRights.ToString(), new { id = Model.UserId }, new { @class = "btn btn-small" })
        }
        @if (WebRights.Right().Check(EUserRights.WorktimeEdit))
        {
            @Html.ActionLink(Navigation.WorktimeCreate, EActionWorktime.Worktime.ToString(), EControllers.Worktime.ToString(), new { id = Model.UserId }, new { @class = "btn btn-small" })
        }
        @if (WebRights.Right().Check(EUserRights.WorktimeSettingsEdit))
        {
            @Html.ActionLink(Navigation.WorktimeSettings, EActionWorktime.EditWorktimeSettings.ToString(), EControllers.Worktime.ToString(), new { id = Model.UserId }, new { @class = "btn btn-small" })
        }
    </div>
</div>
